package service;

import dao.VegetableDeleteDao;

import java.sql.SQLException;
import java.util.Scanner;

public class deleteService {
    public static void main(String[] args) {
        VegetableDeleteDao vegetableDao = new VegetableDeleteDao();
        boolean flag = false;
        System.out.println("请输入想删除的蔬菜名称:");
        Scanner scanner = new Scanner(System.in);
        String vegetableName = scanner.nextLine();
        try {

            if(vegetableDao.deleteVegetable(vegetableName)){
                System.out.println("删除成功");
            }else {
                System.out.println("删除失败");
            }
        } catch (SQLException e) {
            System.out.println("删除异常");
        }
    }
}
